package com.ziiwee.reduce.describe;

public enum ResourceMethod {

    FIND_ALL("findAll", "GET", "/%s", "列表"),

    FIND_ONE("findOne", "GET", "/%s/{id}", "获取"),

    CREATE("create", "POST", "/%s", "新增"),

    UPDATE("update", "PATCH", "/%s/{id}", "更新（局部）"),

    DELETE("delete", "DELETE", "/%s/{id}", "删除"),

    ;

    private final String methodName;
    private final String httpMethod;
    private final String pattern;
    private final String label;

    ResourceMethod(String methodName, String httpMethod, String pattern, String label) {
        this.methodName = methodName;
        this.httpMethod = httpMethod;
        this.pattern = pattern;
        this.label = label;
    }

    public String getMethodName() {
        return methodName;
    }

    public String getHttpMethod() {
        return httpMethod;
    }

    public String getPattern() {
        return pattern;
    }

    public String getLabel() {
        return label;
    }
}
